VideoHelp Forum




+ Reply to Thread
Results 1 to 4 of 4
  1. Member
    Join Date
    Mar 2011
    Location
    Paris, France
    Search PM
    Hello

    I need to join three MP4 files, where, for some reason, the last two have two audio files:

    Code:
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file1.mp4':
      Metadata:
        major_brand     : mp42
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        creation_time   : 2036-02-06 06:28:16
        encoder         : HandBrake 0.10.2 2015060900
      Duration: 00:12:52.10, start: 0.000000, bitrate: 525 kb/s
    
        Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709), 720x410 [SAR 8651:8640 DAR 211:120], 390 kb/s, 30 fps, 30 tbr, 90k tbn, 180k tbc (default)
        Metadata:
          creation_time   : 2036-02-06 06:28:16
          handler_name    : VideoHandler
    
        Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
        Metadata:
          creation_time   : 2036-02-06 06:28:16
          handler_name    : Stereo
    
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file2.mp4':
      Metadata:
        major_brand     : mp42
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        creation_time   : 2036-02-06 06:28:16
        encoder         : HandBrake 0.10.2 2015060900
    
      Duration: 00:13:50.77, start: 0.000000, bitrate: 750 kb/s
        Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709), 720x406 [SAR 406:405 DAR 16:9], 356 kb/s, 30 fps, 30 tbr, 90k tbn, 180k tbc (default)
        Metadata:
          creation_time   : 2036-02-06 06:28:16
          handler_name    : VideoHandler
    
        Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 160 kb/s (default)
        Metadata:
          creation_time   : 2036-02-06 06:28:16
          handler_name    : Stereo
    
        Stream #0:2(und): Audio: ac3 (ac-3 / 0x332D6361), 44100 Hz, stereo, fltp, 224 kb/s
        Metadata:
          creation_time   : 2036-02-06 06:28:16
          handler_name    : Stereo
          
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file3.mp4':
      Metadata:
        major_brand     : mp42
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        creation_time   : 2036-02-06 06:28:16
        encoder         : HandBrake 0.10.2 2015060900
    
      Duration: 00:07:34.67, start: 0.000000, bitrate: 673 kb/s
        Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709), 720x406 [SAR 406:405 DAR 16:9], 279 kb/s, 30 fps, 30 tbr, 90k tbn, 180k tbc (default)
        Metadata:
          creation_time   : 2036-02-06 06:28:16
          handler_name    : VideoHandler
    
        Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 160 kb/s (default)
        Metadata:
          creation_time   : 2036-02-06 06:28:16
          handler_name    : Stereo
    
        Stream #0:2(und): Audio: ac3 (ac-3 / 0x332D6361), 44100 Hz, stereo, fltp, 224 kb/s
        Metadata:
          creation_time   : 2036-02-06 06:28:16
          handler_name    : Stereo
    If I use ffmpeg the standard way, in the output, the last two parts have no audio.

    Does someone know how to 1) check which audio stream actually has audio, and 2) tell ffmpeg to use that audio stream?

    Thank you.
    Last edited by yetanotherlogin; 19th Nov 2015 at 05:49.
    Quote Quote  
  2. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    You can use ffplay with the -ast option to specify one or the other of the audio streams to check their content. Then run ffmpeg with the -map option to specify the audio stream you want to output.
    Quote Quote  
  3. Member
    Join Date
    Mar 2011
    Location
    Paris, France
    Search PM
    Thanks much for the infos.

    Here's how to play a video by using a specific audio stream:
    Code:
    ffplay -ast 1 -i input.mp4
    And here's how to tell ffmpeg to include the video stream and use that audio stream in the output file:
    Code:
    ffmpeg -i input.mp4 -map 0:v -map 0:a:1 output.mp4
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!